<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"       xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditCustomerTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                   <p:outputLabel value="Adı:" for="name" />
                    <p:inputText  id="name" value="#{customerController.selected.name}" title="#{bundle.EditCustomerTitle_name}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_name}"/>
                    <p:outputLabel value="Soyadı:" for="surname" />
                    <p:inputText  id="surname" value="#{customerController.selected.surname}" title="#{bundle.EditCustomerTitle_surname}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_surname}"/>
                    <p:outputLabel value="Adres:" for="address" />
                    <p:inputText  id="address" value="#{customerController.selected.address}" title="#{bundle.EditCustomerTitle_address}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_address}"/>
                    <p:outputLabel value="Kullanıcı Adı" for="username" />
                    <p:inputText  id="username" value="#{customerController.selected.username}" title="#{bundle.EditCustomerTitle_username}" />
                    <p:outputLabel value="Şifre" for="password" />
                    <p:inputText  id="password" value="#{customerController.selected.password}" title="#{bundle.EditCustomerTitle_password}" />
                    <p:outputLabel value="E-Mail" for="email" />
                    <p:inputText  id="email" value="#{customerController.selected.email}" title="#{bundle.EditCustomerTitle_email}" />
                    <p:outputLabel value="İlçe" for="countyid" />
                    <p:selectOneMenu id="countyid" value="#{customerController.selected.countyid}" title="#{bundle.EditCustomerTitle_countyid}" >
                        <f:selectItems value="#{countyController.countyList}"/>
                    </p:selectOneMenu>
                    <p:outputLabel value="Şehir" for="cityid" />
                    <p:selectOneMenu id="cityid" value="#{customerController.selected.cityid}" title="#{bundle.EditCustomerTitle_cityid}" >
                        <f:selectItems value="#{citysController.cityList}"/>
                    </p:selectOneMenu>
                </h:panelGrid>
                <p:commandButton value="Güncelle"  action="#{customerController.update}" ajax="false" icon="ui-icon-disk" />
                
            </h:form>
        </ui:define>
    </ui:composition>

</html>
